<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
                template="./template/HomemasterAd.xhtml"
                xmlns:h="http://xmlns.jcp.org/jsf/html"
                xmlns:p="http://primefaces.org/ui"
                xmlns:f="http://xmlns.jcp.org/jsf/core">

    <ui:define name="content_top">
        Service
    </ui:define>

    <ui:define name="content">
        <h:form prependId="false">
            <p:commandLink action="#{serviceManagedBean.add()}">
                <h:graphicImage library="admin/images" name="b_add.png" width="30px"/>Add
            </p:commandLink>
            &nbsp;&nbsp;
            <p:commandLink action="#{serviceManagedBean.recoverDatadelete()}">
                <h:graphicImage library="admin/images" name="b_data.png" width="30px"/>Recover Deleted Data
            </p:commandLink>
            <p:dataTable var="svice" value="#{serviceManagedBean.sudungtruyvan()}">
                <p:column>
                    <f:facet name="header">Name</f:facet>
                        #{svice.name}
                </p:column>
                <p:column>
                    <f:facet name="header">Descriptions</f:facet>
                        #{svice.descriptions}
                </p:column>
                <p:column>
                    <f:facet name="header">Detail Descriptions</f:facet>
                        #{svice.detailDescription}
                </p:column>
                <p:column>
                    <f:facet name="header">Price</f:facet>
                        #{svice.price.doubleValue()}
                </p:column>
                <p:column>
                    <f:facet name="header">Status</f:facet>
                        #{svice.status}
                </p:column>
                <p:column>
                    <f:facet name="header">Domain</f:facet>
                        #{svice.domainID.name}
                </p:column>

                <p:column>
                    <f:facet name="header"></f:facet>
                    <h:commandLink action="#{serviceManagedBean.edit(svice)}">
                        <h:graphicImage library="admin/images" name="b_edit.png"/>
                    </h:commandLink>
                    &nbsp;
                    <h:commandLink action="#{serviceManagedBean.xoaAn(svice)}" onclick="return confirm('Are you sure!')">
                        <h:graphicImage library="admin/images" name="b_drop.png"/>
                    </h:commandLink>
                </p:column>
            </p:dataTable>
        </h:form>

    </ui:define>

</ui:composition>
